home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
tex-k
/
tex-k-archive.past
/
1994.12.gz
/
1994.12
/
000034_djb@silverton.berkeley.edu_Tue Dec 6 17:53:37 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-12-30
|
2KB
Received: from silverton.Berkeley.EDU by cs.umb.edu with SMTP id AA18641
(5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 7 Dec 1994 04:37:25 -0500
Received: from localhost (djb@localhost) by silverton.berkeley.edu (8.6.4/8.6.4) id BAA19398; Wed, 7 Dec 1994 01:53:37 -0800
Date: Wed, 7 Dec 1994 01:53:37 -0800
From: "D. J. Bernstein" <djb@silverton.berkeley.edu>
Message-Id: <199412070953.BAA19398@silverton.berkeley.edu>
To: djb@silverton.berkeley.edu, tex-k@cs.umb.edu
Subject: Re: bsdi trip failure
When my compiler converts the integer constant -2^31 to double, it gets
+2^31. zround.c checks whether a double r is smaller than INTEGER_MIN;
the answer is always yes. I reported this to Karl and changed zround.c.
Now TeX passes trip and seems to work fine.
Question: What exactly is zround(r) trying to accomplish?
Originally it returned (int) (r + 0.5) if r is positive or zero, and
(int) (r - 0.5) if r is negative. This makes sense for _some_ machines,
where casting to int means truncating towards zero. It makes absolutely
no sense on other machines. If the exact value of zround(r) is not too
important, just use (int) r. If you want to spend the time to get the
right answer, use (int) rint(r).
The new zround() has some extra tests: it returns INTEGER_MIN if
r < INTEGER_MIN, INTEGER_MAX if r > INTEGER_MAX. I don't like this.
Should the return value from zround(r) for particular files be a
function of the machine's word size? It would make much more sense to
check r against -2^31 and 2^31-1, the guaranteed range of a TeX integer.
---Dan